<!DOCTYPE html>
<html>
	<head>
	    <style>
	        .toolbar {
	            border: 1px solid #ccc;
	        }
	        .text1 {
	            border: 1px solid #ccc;
	            min-height: 500px;
	        }
	    </style>
	</head>
	<body>
		<input id="button1" type="button" value="打印" />
	    <div id="div1">
	        
	    </div>
		
		
		<script src="http://cdn.bootcss.com/highlight.js/8.0/highlight.min.js"></script>
	    
	    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	    <script type="text/javascript" src="//unpkg.com/wangeditor/dist/wangEditor.min.js"></script>
	    <script type="text/javascript">
	        const E = window.wangEditor
	        const editor = new E('#div1');
			editor.config.zIndex = 500;
			editor.config.uploadImgShowBase64 = true;
			// 挂载highlight插件
			editor.highlight = hljs;
	        const $text1 = $('#text1')
	        /* editor.config.onchange = function (html) {
	            // 第二步，监控变化，同步更新到 textarea
	            $text1.val(html)
	        } 
			// 第一步，初始化 textarea 的值
			$text1.val(editor.txt.html())*/
	        editor.create();
	    
	        
			
			$("#button1").click(function(){
				console.log(editor.txt.html());
				alert(editor.txt.html());
			})
	    </script>
	</body>
	
</html>
